﻿CREATE TABLE [dbo].[BoardGamePlayerGroup]
(
	[BoardGamePlayerGroupId] INT NOT NULL identity(1,1),
	[BoardGameId] INT NOT NULL,
	[Name] nvarchar(128) not null,
	[MaxPlayers] int not null,
	[CreatedBy] NVARCHAR(256) NOT NULL, 
	[CreateDate] DATETIME NOT NULL, 
	[ModifiedBy] NVARCHAR(256) NOT NULL, 
	[ModifyDate] DATETIME NOT NULL, 
	constraint PK_BoardGamePlayerGroup primary key ([BoardGamePlayerGroupId]),
	constraint FK_BoardGamePlayerGroup_IsPlaying_BoardGame FOREIGN KEY (BoardGameId)
		references BoardGame ([BoardGameId])
)
go
create unique index UX_BoardGamePlayerGroup_BoardGameId_Name on dbo.[BoardGamePlayerGroup] (BoardGameId,Name)
go
create index IX_BoardGamePlayerGroup_BoardGameId on dbo.BoardGamePlayerGroup (BoardGameId)
go

